package com.yhq.yhqproject.base.config;

//import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//import org.springframework.data.mongodb.core.MongoDatabaseFactorySupport;
//import org.springframework.data.mongodb.core.MongoTemplate;
//import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper;
//import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.Resource;

@EnableTransactionManagement
@Configuration
public class MongoDBConfig {

//    @Resource
//    private MongoDatabaseFactorySupport mongoDatabaseFactory;
//
//    @Resource
//    private MappingMongoConverter mappingMongoConverter;
//
//    @Bean
//    public MongoTemplate mongoTemplate() {
//        //配置存储不添加class
//        mappingMongoConverter.setTypeMapper(new DefaultMongoTypeMapper(null));
//        MongoTemplate mongoTemplate = new MongoTemplate(mongoDatabaseFactory, mappingMongoConverter);
//        return mongoTemplate;
//    }
}
